package com.lqk.facade;

/**
 * @author lqk
 * @date 2021/12/6 18:11
 *
 * 爆米花
 */
public class Popcorn {
    private Popcorn(){

    }
    // 使用单例模式，静态内部类
    private static class PopcornInstance{
        private static final Popcorn INSTANCE = new Popcorn();
    }

    // 提供一个静态的公有方法，直接返回 SingletonInstance.INSTANCE
    public static Popcorn getInstance(){
        return Popcorn.PopcornInstance.INSTANCE;
    }

    public void on(){
        System.out.println(" popcorn on ");
    }
    public void off(){
        System.out.println(" popcorn off ");
    }
    public void pop(){
        System.out.println(" popcorn is popping ");
    }

}
